<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/reset.css">
    <link rel="stylesheet" href="../libs/font/iconfont.css">
    <link rel="stylesheet" href="../css/base.css">
    <link rel="stylesheet" href="../css/cart.css">
</head>
<body>
    <header></header>
    <div class="main">
        <div class="main-top">
            <span><i class="iconfont icon-quan"></i>购物车可以领优惠券哦~~</span>
            <button>领券 ></button>
        </div>
        <ul class="main-bottom"></ul>
        <div class="ul-bottom">
            <div class="bottom-left">
                <input type = "checkbox" class="allSelect">
                <span class="delAll">删除选中</span>
            </div>
            <div class="bottom-right">
                <span>已选商品<b class="totalNum">0</b>件</span>
                <span>合计：￥<b class="totalMoney">0</b>元</span>
                <button>下单</button>
            </div>
        </div>
    </div>
    <footer></footer>
    <script src="../libs/jquery.min.js"></script>
    <script src="../libs/cookie.js"></script>
    <script src="../js/cart.js"></script>
    <script>
         $('header').load('../html/header.html',()=>{
            let login = document.querySelector('.login')
            let sp1 = document.querySelector('.sp1')
            let sp2 = document.querySelector('.sp2')
            if(getCookie('username')){
                login.style.display = 'none'
                sp1.style.display = 'block'
                sp2.style.display = 'none'
                sp1.innerHTML = `欢迎：${getCookie('username')}`
                sp2.onclick = ()=>{
                    login.style.display = 'block'
                    sp1.style.display = 'none'
                    sp2.style.display = 'none'
                    delCookie('username')
                    delCookie('password')
                    localStorage.clear()
                    window.totalNum()
                }
            }
         })
         $('footer').load('../html/footer.html')
    </script>
</body>
</html>